package ir.types.datatypes;

import ir.types.Type;

public class IntegerType extends DataType {
    public static final IntegerType I32 = new IntegerType(32);
    public static final IntegerType I8 = new IntegerType(8);
    public static final IntegerType I1 = new IntegerType(1);
    private final int bits;

    private IntegerType(int bits) {
        this.bits = bits;
    }

    @Override
    public String toString() {
        return "i" + bits;
    }

    @Override
    public int getSize() {
        return bits / 8;
    }

    public boolean isI32() {
        return bits == 32;
    }

    public boolean isI1() {
        return bits == 1;
    }


}
